Dark-Mailer V.2.2 © by p0LYM0rPH2012 and ZyphoMud DarkenedCore Admin Team
1)
{
$b[]=$a[0];
$c++;
for($i=0;$i<$c;$i++)
{
$a=strlen($b[$i]);
if($a>1)
for($j=0;$j<$a;$j++)
{
$d=ord($b[$i]{$j});
if(($d>47 && $d<58) || ($d>97 && $d<123));
elseif($j==0) return FALSE;
elseif($d==45 || $d==95);
elseif($i==(count($b)-1) && $d==46);
else return FALSE;
}
else return FALSE;
}
}
else return FALSE;
}
else return FALSE;
return TRUE;
}
function bbcodes($text)
{
$new = stripslashes($text);
$new = preg_replace("/\[img\](.*)\[\/img\]/isU", " ", $new);
$new = preg_replace("/\[center\](.*)\[\/center\]/isU", "$1", $new);
$new = preg_replace("/\[b\](.*)\[\/b\]/isU", "$1", $new);
$new = preg_replace("/\[i\](.*)\[\/i\]/isU", "$1", $new);
$new = preg_replace("/\[u\](.*)\[\/u\]/isU", "$1", $new);
$new = eregi_replace("([ \r\n])www\\.([^ ,\r\n]*)","\\1http://www.\\2",$new);
$new = eregi_replace("([ \r\n])http\:\/\/www\\.([^ ,\r\n]*)","\\1http://www.\\2",$new);
$new = preg_replace("/\[url\]www.(.*)\[\/url\]/isU", "http://www.$1", $new);
$new = preg_replace("/\[url\](.*)\[\/url\]/isU", "$1", $new);
$new = preg_replace("/\[red\](.*)\[\/red\]/isU", "$1", $new);
$new = preg_replace("/\[blue\](.*)\[\/blue\]/isU", "$1", $new);
$new = preg_replace("/\[yellow\](.*)\[\/yellow\]/isU", "$1", $new);
$new = preg_replace("/\[size=(.*)\](.*)\[\/size\]/isU", "$2", $new);
$new = preg_replace("/\[color=(.*)\](.*)\[\/color\]/isU", "$2", $new);
$new = preg_replace("/\[quote\](.*)\[\/quote\]/isU", "", $new);
$new = preg_replace("/\[quote=(.*)\](.*)\[\/quote\]/isU", "", $new);
$new = nl2br($new);
return $new;
}
$to = $_POST['to'];
$mails = split("\n",$to);
$from = $_POST['from'];
$Reply = $_POST['reply'];
$subject = $_POST['subject'];
if(get_magic_quotes_gpc ())
{
$Message = stripslashes($_POST['message']);
}
else
{
$Message = $_POST['message'];
}
$sendername = $_POST['sendername'];
$contenttype = $_POST['ctype'];
if($_POST['ctype'] == "bbhtml"){
$contenttype = "html";$Message = bbcodes($Message);}
else
$contenttype = $_POST['ctype'];
$passthrough = $_POST['count'];
$Message = str_replace("{email}", $from, $Message);
$subject = str_replace("{email}", $from, $subject);
if(isset($_POST['submit']))
{
if($_FILES["file"]["tmp_name"] != "" && $_FILES["file"] != " ")
{
$UPLOAD = 1;
$Filename = $_FILES["file"]["tmp_name"];
$FilenameMail = $_POST['fakefilename'];
$FileType= $_FILES["file"]["type"];
@chmod("./",777);
move_uploaded_file($Filename, "./$FilenameMail") or die("The file you are trying to upload couldn't be copied to the server. Maybe no R/W Access?");
$content = fread(fopen($FilenameMail,"r"),filesize($FilenameMail));
$content = chunk_split(base64_encode($content));
}
$Header = "From: $sendername <$from>\r\nReply-To: $Reply\r\n";
$uid = strtoupper(md5(uniqid(time())));
$header = "From: $sendername <$from>\r\nReply-To: $Reply\r\n";
$header .= "MIME-Version: 1.0\r\n";
If ($UPLOAD) $header .= "Content-Type: multipart/mixed; boundary=$uid\r\n";
If ($UPLOAD) $header .= "--$uid\r\n";
$header .= "Content-Type: text/$contenttype\r\n";
$header .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$header .= "$Message\r\n";
If ($UPLOAD) $header .= "--$uid\r\n";
If ($UPLOAD) $header .= "Content-Type: $FileType; name=\"$FilenameMail\"\r\n";
If ($UPLOAD) $header .= "Content-Transfer-Encoding: base64\r\n";
If ($UPLOAD) $header .= "Content-Disposition: attachment; filename=\"$FilenameMail\"\r\n\r\n";
If ($UPLOAD) $header .= "$content\r\n";
If ($UPLOAD) $header .= "--$uid--";
@unlink ($FilenameMail);
$count = 0;
do
{
foreach($mails as $mail)
{
@set_time_limit(10);
if($mail != "" && $mail != " ")
{
echo "Sending Mail to ".$mail."...\n\r ";
flush();
mail($mail, $subject, "", $header);
$count++;
}
}
$passthrough--;
}while($passthrough != 0);
echo "".$count." Mail(s) sent
";
echo " Back";
if(file_exists ("DMPReview.html"))
@unlink("DMPReview.html");
?>
|